package appapi.Vo.record;

import appapi.common.BaseEntity;
import appapi.dto.AddMaintenandetailDto;
import appapi.entity.Zhongjiao.EquipmentmaintenanDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 请求对象
 *
 * @author luocheng
 * @version 1.0
 * @date 2023/06/03 12:19
 */
@ApiModel
@Data
public class EditMaintenanVo {

    /**
     * 维保记录ID
     */
    @ApiModelProperty(value = "维保记录ID")
    private Long mainId;
    /**
     * 设备id
     */
    @ApiModelProperty(value = "设备id")
    private Long equipId;

    /**
     * 类型
     */
    @ApiModelProperty(value = "类型")
    private Integer mainType;

    /**
     * 来源
     */
    @ApiModelProperty(value = "来源")
    private Integer mainSource;

    /**
     * 维保状态
     */
    @ApiModelProperty(value = "维保状态(0-已完成,1未完成,2异常)")
    private Integer mainState;

    /**
     * 维保人员
     */
    @ApiModelProperty(value = "维保人员")
    private Integer operId;

    @ApiModelProperty(value = "维保人员姓名")
    private String operName;

    /**
     * 维保时间
     */
    @ApiModelProperty(value = "维保时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime mainDate;

    /**
     * 维保结果(0-已完成,1未完成,2-异常)
     */
    @ApiModelProperty(value = "维保结果(0-已完成,1未完成,2-异常)")
    private Integer mainResult;

    /**
     * 维保备注
     */
    @ApiModelProperty(value = "维保备注")
    private String mainNote;

    /**
     * 整改要求
     */
    @ApiModelProperty(value = "整改要求")
    private String expRequire;

    /**
     * 附件地址
     */
    @ApiModelProperty(value = "附件地址")
    private List<String> annexUrl;

    /**
     * 维保条目
     */
    @ApiModelProperty(value = "维保条目")
    private List<EditMaintenanDetailVo> mainDetails;
    public EquipmentmaintenanDto vo2Entity() {
        EquipmentmaintenanDto entity = new EquipmentmaintenanDto();
        BeanUtils.copyProperties(this, entity);
        return entity;
    }
}
